//
//  DdxTv.swift
//  ddx0513
//
//  Created by jiang yongbin on 15/5/13.
//  Copyright (c) 2015年 jiang yongbin. All rights reserved.
//

import UIKit

class FirstTvController: UITableView ,UITableViewDataSource,UITableViewDelegate{
    
    let TAG_CELL_LABEL = 1
    let dataArr=["hi","diandian","hello"]
    
    required init(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        self.dataSource=self
        self.delegate = self
    }
    
    override init(frame: CGRect) {
        super.init(frame: frame)
    }
    func numberOfSectionsInTableView(tableView: UITableView) -> Int {
        return 1
    }
    
    
    
    func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
        var cell :AnyObject! = tableView.dequeueReusableCellWithIdentifier("cell")
        var label = cell!.viewWithTag(TAG_CELL_LABEL) as! UILabel
        label.text = dataArr[indexPath.row]
        return cell as! UITableViewCell
        
    }
    
    func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return 3
    }
    
    func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath)
    {
        
    }
    
    /*
    // Only override drawRect: if you perform custom drawing.
    // An empty implementation adversely affects performance during animation.
    override func drawRect(rect: CGRect) {
    // Drawing code
    }
    */
    
}